﻿using System;
using System.Collections.Generic;
using System.Linq;
using Coleotrack.Data.Contracts;

namespace Coleotrack.Data
{
    public class Issue : Entity, IValidation
    {
        public virtual string Title { get; set; }

        public virtual Project Project { get; set; }

        public virtual Area Area { get; set; }

        public virtual Release ReportedForRelease { get; set; }

        public virtual Release SolvedInRelease { get; set; }

        public virtual Category Category { get; set; }

        public virtual User AssignedTo { get; set; }

        public virtual Status Status { get; set; }

        public virtual Priority Priority { get; set; }

        public virtual Issue Parent { get; set; }

        public virtual DateTime? Due { get; set; }

        public virtual Effort Effort { get; set; }

        public virtual IList<Tag> Tags { get; set; }

        public virtual string Description { get; set; }

        public virtual bool IsValid()
        {
            return GetRuleViolations().Count() == 0;
        }

        public virtual IEnumerable<RuleViolation> GetRuleViolations()
        {
            yield break;
        }
    }
}
